﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Traders.Views
{
    public partial class ConnectingProgress : Form
    {
        public ConnectingProgress()
        {
            InitializeComponent();
        }

        private delegate void UpdateDelegate(int Progress);

        public void UpdateProgress(int Progress)
        {
            if (Progress < 0) Progress = 0;
            if (Progress > 100) Progress = 100;
            if ( this.InvokeRequired )
                this.Invoke((UpdateDelegate)UpdateProgress, Progress);
            else
                this.ProgressBar.Value = Progress;
        }
    }
}
